<template>
	<view>
		<u-toast ref="uToast"></u-toast>
		<u-navbar :placeholder="true" @leftClick="goBack" title="意见反馈"></u-navbar>
		<view class="margin-tb-lg margin-lr-sm">
			<u--textarea v-model="content" placeholder="请输入您的宝贵意见" count :maxlength="200"></u--textarea>
		</view>
		<view class="flex align-center justify-center">
			<button class="cu-btn bg-tea" @click="submit">提交意见</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: '',
			}
		},
		methods: {
			goBack() {
				uni.navigateBack();
			},
			submit() {
				if (this.content.length <= 0) {
					this.$refs.uToast.show({
						message: '请输入您的宝贵意见',
						type: 'error',
						position: 'center'
					})
					return;
				}
				uni.$u.http.post('/Customer/FeedBack', {
					content: this.content
				}).then(res => {
					this.$refs.uToast.show({
						message: res.msg,
						type: 'success',
						position: 'center'
					});
					this.content = '';
				})
			}
		}
	}
</script>

<style>
</style>
